import {
  http
} from '@/utils/http.js'


/**
 * 忘记密码
 */
export const updatePwdAPI = (data) => {
  return http({
    url: `/reset/password?phone=${data.phone}&password=${data.password}&code=${data.code}`,
    method: 'POST',
  })
}


/**
 * 获取用户信息
 */
export const getUserInfoAPI = () => {
  return http({
    url: '/user/',
    method: 'GET'
  })
}


/**
 * 根据文件名获取图片
 */
export const getAvatarAPI = (fileName) => {
  return http({
    url: `/img/${fileName}`,
  })
}


/**
 * 更新昵称
 */
export const updateNickNameAPI = (data) => {
  return http({
    url: '/user/edit/username',
    method: 'POST',
    data
  })
}
